{% extends "base.html" %}
{%load pagination_tags%}

{%block title%}Moje zakłady{%endblock%}

{% block content %}
	<div id="content">
		<div class="post">
			<div class="title">
				<h2>Zakłady</h2>
			</div>
			<div class="entry">
			    <form method="POST" action="{%url profile-bets-add%}" id="id_add_bet" style="display:none;">
			    {%csrf_token%}
			        {{aform.mode}}{{aform.nums}}
					<span class="m-l">Ilość losowań:</span> {{aform.quantity}} <input type="submit" id="pick" value="Dodaj" />
			    </form>
				<form method="POST" action="">
				    {% csrf_token %}
				    {{form.mode}}
				    <span class="m-l"><b>Sortuj:</b></span> <a href="?sort=asc">Rosnąco</a> | <a href="?sort=desc">Malejąco</a>
            	</form>
            	<br />
				<table class="results">
		    		<tr>
			        	<th>Data dodania</th>
			        	<th>Ilość</th>
			        	<th>Liczby</th>
			        	<th><input type="button" id="add" value="+" onclick="$('#id_add_bet').toggle('slow');" /></th>
			    	</tr>
		            {%for lotto in lottos_list%}
		            <tr>
		                <td><small>{{lotto.date}}</small></td>
		                <td>{{lotto.quantity}}</td>
		        		<td><pre>{{lotto.as_str}}</pre></td>
		        		<td><a href="{%url profile-bets-del lotto.id%}">x</a></td>
				    </tr>
		            {%empty%}
		            <tr>
		                <td colspan="4">Brak danych</td>
				    </tr>
		            {%endfor%}
		            <tr>
		                <td class="ta-c" colspan="4">{%paginate%}</td>
		            </tr>
	            </table>
			</div>
		</div>
	</div>
{% endblock %}
